home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Events / ScreenPart.cp < prev    next >
Text File  |  2000-06-23  |  681b  |  37 lines

  1. // ScreenPart.cp
  2.  
  3. #ifndef ScreenPart_h
  4. #include "ScreenPart.h"
  5. #endif
  6. #ifndef WindowObject_h
  7. #include "WindowObject.h"
  8. #endif
  9.  
  10. ScreenPart::ScreenPart( PointObject where )
  11.   {
  12.     WindowPtr windowPtr;
  13.     part = static_cast<PartCode>( FindWindow( where, &windowPtr ) );
  14.     window = reinterpret_cast<WindowObject *>( windowPtr );
  15.     
  16.     if ( part == desktop || part == menuBar )
  17.         window = 0;
  18.      else
  19.       {
  20.         Assert( window != 0 );
  21.  
  22.         switch ( part )
  23.           {
  24.             case windowGrowBox:
  25.                 Assert( window->IsFrontmost() );
  26.                 break;
  27.             
  28.             case windowCloseBox:
  29.             case windowZoomInBox:
  30.             case windowZoomOutBox:
  31.                 if ( !window->IsFrontmost() )
  32.                     part = windowDragRegion;
  33.                 break;
  34.           }
  35.       }
  36.   }
  37.